package com.zookeeper;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;

/**
 * Created by dong peng on 2017/12/7.
 */
class MyWatcher implements Watcher {

    public void process(WatchedEvent watchedEvent) {
        System.out.println("--------------watcher监听-----------");
        System.out.println(watchedEvent.toString());
        System.out.println(watchedEvent.getState());
        if(Event.KeeperState.SyncConnected == watchedEvent.getState()) {
            System.out.println("链接已建立");
        }
    }
}
